import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '长度',
    align: "center",
    dataIndex: 'length'
  },
  {
    title: '创建时间',
    align: "center",
    dataIndex: 'createdAt'
  },
  {
    title: '更新时间',
    align: "center",
    dataIndex: 'updatedAt'
  },
  {
    title: '路段id',
    align: "center",
    dataIndex: 'roadId'
  },
  {
    title: '桩号结束',
    align: "center",
    dataIndex: 'endPoint'
  },
  {
    title: '桩号开始',
    align: "center",
    dataIndex: 'startPoint'
  },
  {
    title: '路段名称',
    align: "center",
    dataIndex: 'name'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "路段名称",
    field: 'name',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '长度',
    field: 'length',
    component: 'InputNumber',
  },
  {
    label: '创建时间',
    field: 'createdAt',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '更新时间',
    field: 'updatedAt',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '路段id',
    field: 'roadId',
    component: 'InputNumber',
  },
  {
    label: '桩号结束',
    field: 'endPoint',
    component: 'Input',
  },
  {
    label: '桩号开始',
    field: 'startPoint',
    component: 'Input',
  },
  {
    label: '路段名称',
    field: 'name',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
